\hypertarget{group__interrupt__api}{
\section{Interrupt\_\-api}
\label{group__interrupt__api}\index{Interrupt\_\-api@{Interrupt\_\-api}}
}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
tBoolean \hyperlink{group__interrupt__api_ga86b7d4280e84ac5944ef231283732582}{IntMasterDisable} (void)
\item 
void \hyperlink{group__interrupt__api_ga471d00d73ae22faa426c202f608e9c69}{IntRegister} (unsigned long ulInterrupt, void($\ast$pfnHandler)(void))
\item 
void \hyperlink{group__interrupt__api_ga71111e6f7041c56eff3d2335b4661d99}{IntUnregister} (unsigned long ulInterrupt)
\item 
void \hyperlink{group__interrupt__api_gace950d5ba5a1f58f3590ac4f36f0590a}{IntPriorityGroupingSet} (unsigned long ulBits)
\item 
unsigned long \hyperlink{group__interrupt__api_ga3edfd6783bfb82ed1345b739588e0e45}{IntPriorityGroupingGet} (void)
\item 
void \hyperlink{group__interrupt__api_ga87bfd6b1df41a7c4c9e1743eda5f7a05}{IntPrioritySet} (unsigned long ulInterrupt, unsigned char ucPriority)
\item 
long \hyperlink{group__interrupt__api_gab4dbd2d4b6c0174cc324ae670eb5076f}{IntPriorityGet} (unsigned long ulInterrupt)
\item 
void \hyperlink{group__interrupt__api_gaa17d17172b0304d0dc0596d7a0c86173}{IntEnable} (unsigned long ulInterrupt)
\item 
void \hyperlink{group__interrupt__api_ga4b925440c7dcb80abac260172b0a0b9c}{IntDisable} (unsigned long ulInterrupt)
\item 
void \hyperlink{group__interrupt__api_ga67b4920005d365341bece79bb070669f}{IntPendSet} (unsigned long ulInterrupt)
\item 
void \hyperlink{group__interrupt__api_gad345852ce657fe5397170c06a8066605}{IntPendClear} (unsigned long ulInterrupt)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{group__interrupt__api_ga4b925440c7dcb80abac260172b0a0b9c}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntDisable@{IntDisable}}
\index{IntDisable@{IntDisable}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntDisable}]{\setlength{\rightskip}{0pt plus 5cm}void IntDisable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulInterrupt}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_ga4b925440c7dcb80abac260172b0a0b9c}
Disables an interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulInterrupt}]specifies the interrupt to be disabled.\end{DoxyParams}
The specified interrupt is disabled in the interrupt controller. Other enables for the interrupt (such as at the peripheral level) are unaffected by this function.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_gaa17d17172b0304d0dc0596d7a0c86173}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntEnable@{IntEnable}}
\index{IntEnable@{IntEnable}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntEnable}]{\setlength{\rightskip}{0pt plus 5cm}void IntEnable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulInterrupt}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_gaa17d17172b0304d0dc0596d7a0c86173}
Enables an interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulInterrupt}]specifies the interrupt to be enabled.\end{DoxyParams}
The specified interrupt is enabled in the interrupt controller. Other enables for the interrupt (such as at the peripheral level) are unaffected by this function.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_ga86b7d4280e84ac5944ef231283732582}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntMasterDisable@{IntMasterDisable}}
\index{IntMasterDisable@{IntMasterDisable}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntMasterDisable}]{\setlength{\rightskip}{0pt plus 5cm}tBoolean IntMasterDisable (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_ga86b7d4280e84ac5944ef231283732582}
Disables the processor interrupt.

Prevents the processor from receiving interrupts. This does not affect the set of interrupts enabled in the interrupt controller; it just gates the single interrupt from the controller to the processor.

\begin{DoxyNote}{Note}
Previously, this function had no return value. As such, it was possible to include {\ttfamily \hyperlink{interrupt_8h_source}{interrupt.h}} and call this function without having included {\ttfamily hw\_\-types.h}. Now that the return is a {\ttfamily tBoolean}, a compiler error will occur in this case. The solution is to include {\ttfamily hw\_\-types.h} before including {\ttfamily \hyperlink{interrupt_8h_source}{interrupt.h}}.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
Returns {\bfseries true} if interrupts were already disabled when the function was called or {\bfseries false} if they were initially enabled. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_gad345852ce657fe5397170c06a8066605}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntPendClear@{IntPendClear}}
\index{IntPendClear@{IntPendClear}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntPendClear}]{\setlength{\rightskip}{0pt plus 5cm}void IntPendClear (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulInterrupt}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_gad345852ce657fe5397170c06a8066605}
Unpends an interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulInterrupt}]specifies the interrupt to be unpended.\end{DoxyParams}
The specified interrupt is unpended in the interrupt controller. This will cause any previously generated interrupts that have not been handled yet (due to higher priority interrupts or the interrupt no having been enabled yet) to be discarded.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_ga67b4920005d365341bece79bb070669f}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntPendSet@{IntPendSet}}
\index{IntPendSet@{IntPendSet}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntPendSet}]{\setlength{\rightskip}{0pt plus 5cm}void IntPendSet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulInterrupt}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_ga67b4920005d365341bece79bb070669f}
Pends an interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulInterrupt}]specifies the interrupt to be pended.\end{DoxyParams}
The specified interrupt is pended in the interrupt controller. This will cause the interrupt controller to execute the corresponding interrupt handler at the next available time, based on the current interrupt state priorities. For example, if called by a higher priority interrupt handler, the specified interrupt handler will not be called until after the current interrupt handler has completed execution. The interrupt must have been enabled for it to be called.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_gab4dbd2d4b6c0174cc324ae670eb5076f}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntPriorityGet@{IntPriorityGet}}
\index{IntPriorityGet@{IntPriorityGet}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntPriorityGet}]{\setlength{\rightskip}{0pt plus 5cm}long IntPriorityGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulInterrupt}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_gab4dbd2d4b6c0174cc324ae670eb5076f}
Gets the priority of an interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulInterrupt}]specifies the interrupt in question.\end{DoxyParams}
This function gets the priority of an interrupt. See \hyperlink{group__interrupt__api_ga87bfd6b1df41a7c4c9e1743eda5f7a05}{IntPrioritySet()} for a definition of the priority value.

\begin{DoxyReturn}{Returns}
Returns the interrupt priority, or -\/1 if an invalid interrupt was specified. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_ga3edfd6783bfb82ed1345b739588e0e45}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntPriorityGroupingGet@{IntPriorityGroupingGet}}
\index{IntPriorityGroupingGet@{IntPriorityGroupingGet}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntPriorityGroupingGet}]{\setlength{\rightskip}{0pt plus 5cm}unsigned long IntPriorityGroupingGet (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_ga3edfd6783bfb82ed1345b739588e0e45}
Gets the priority grouping of the interrupt controller.

This function returns the split between preemptable priority levels and subpriority levels in the interrupt priority specification.

\begin{DoxyReturn}{Returns}
The number of bits of preemptable priority. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_gace950d5ba5a1f58f3590ac4f36f0590a}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntPriorityGroupingSet@{IntPriorityGroupingSet}}
\index{IntPriorityGroupingSet@{IntPriorityGroupingSet}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntPriorityGroupingSet}]{\setlength{\rightskip}{0pt plus 5cm}void IntPriorityGroupingSet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBits}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_gace950d5ba5a1f58f3590ac4f36f0590a}
Sets the priority grouping of the interrupt controller.


\begin{DoxyParams}{Parameters}
\item[{\em ulBits}]specifies the number of bits of preemptable priority.\end{DoxyParams}
This function specifies the split between preemptable priority levels and subpriority levels in the interrupt priority specification. The range of the grouping values are dependent upon the hardware implementation; on the Stellaris family, three bits are available for hardware interrupt prioritization and therefore priority grouping values of three through seven have the same effect.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_ga87bfd6b1df41a7c4c9e1743eda5f7a05}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntPrioritySet@{IntPrioritySet}}
\index{IntPrioritySet@{IntPrioritySet}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntPrioritySet}]{\setlength{\rightskip}{0pt plus 5cm}void IntPrioritySet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulInterrupt, }
\item[{unsigned char}]{ ucPriority}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_ga87bfd6b1df41a7c4c9e1743eda5f7a05}
Sets the priority of an interrupt.


\begin{DoxyParams}{Parameters}
\item[{\em ulInterrupt}]specifies the interrupt in question. \item[{\em ucPriority}]specifies the priority of the interrupt.\end{DoxyParams}
This function is used to set the priority of an interrupt. When multiple interrupts are asserted simultaneously, the ones with the highest priority are processed before the lower priority interrupts. Smaller numbers correspond to higher interrupt priorities; priority 0 is the highest interrupt priority.

The hardware priority mechanism will only look at the upper N bits of the priority level (where N is 3 for the Stellaris family), so any prioritization must be performed in those bits. The remaining bits can be used to sub-\/prioritize the interrupt sources, and may be used by the hardware priority mechanism on a future part. This arrangement allows priorities to migrate to different NVIC implementations without changing the gross prioritization of the interrupts.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_ga471d00d73ae22faa426c202f608e9c69}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntRegister@{IntRegister}}
\index{IntRegister@{IntRegister}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntRegister}]{\setlength{\rightskip}{0pt plus 5cm}void IntRegister (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulInterrupt, }
\item[{void($\ast$)(void)}]{ pfnHandler}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_ga471d00d73ae22faa426c202f608e9c69}
Registers a function to be called when an interrupt occurs.


\begin{DoxyParams}{Parameters}
\item[{\em ulInterrupt}]specifies the interrupt in question. \item[{\em pfnHandler}]is a pointer to the function to be called.\end{DoxyParams}
This function is used to specify the handler function to be called when the given interrupt is asserted to the processor. When the interrupt occurs, if it is enabled (via \hyperlink{group__interrupt__api_gaa17d17172b0304d0dc0596d7a0c86173}{IntEnable()}), the handler function will be called in interrupt context. Since the handler function can preempt other code, care must be taken to protect memory or peripherals that are accessed by the handler and other non-\/handler code.

\begin{DoxyNote}{Note}
The use of this function (directly or indirectly via a peripheral driver interrupt register function) moves the interrupt vector table from flash to SRAM. Therefore, care must be taken when linking the application to ensure that the SRAM vector table is located at the beginning of SRAM; otherwise NVIC will not look in the correct portion of memory for the vector table (it requires the vector table be on a 1 kB memory alignment). Normally, the SRAM vector table is so placed via the use of linker scripts; some tool chains, such as the evaluation version of RV-\/MDK, do not support linker scripts and therefore will not produce a valid executable. See the discussion of compile-\/time versus run-\/time interrupt handler registration in the introduction to this chapter.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__interrupt__api_ga71111e6f7041c56eff3d2335b4661d99}{
\index{interrupt\_\-api@{interrupt\_\-api}!IntUnregister@{IntUnregister}}
\index{IntUnregister@{IntUnregister}!interrupt_api@{interrupt\_\-api}}
\subsubsection[{IntUnregister}]{\setlength{\rightskip}{0pt plus 5cm}void IntUnregister (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulInterrupt}
\end{DoxyParamCaption}
)}}
\label{group__interrupt__api_ga71111e6f7041c56eff3d2335b4661d99}
Unregisters the function to be called when an interrupt occurs.


\begin{DoxyParams}{Parameters}
\item[{\em ulInterrupt}]specifies the interrupt in question.\end{DoxyParams}
This function is used to indicate that no handler should be called when the given interrupt is asserted to the processor. The interrupt source will be automatically disabled (via \hyperlink{group__interrupt__api_ga4b925440c7dcb80abac260172b0a0b9c}{IntDisable()}) if necessary.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__interrupt__api_ga471d00d73ae22faa426c202f608e9c69}{IntRegister()} for important information about registering interrupt handlers.
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
